#pragma once
#ifndef __TESTHIDDENSINGLE__H__
#define __TESTHIDDENSINGLE__H__

#include "ATTest.h"

class HiddenSingleTestCase : public TestCase
{
public:
	HiddenSingleTestCase(const String& Name) : TestCase(Name)
	{
		Add(NEW_TEST(HiddenSingleTestCase::TestCreate));
		Add(NEW_TEST(HiddenSingleTestCase::TestSolve));
	}
	~HiddenSingleTestCase()
	{
	}

	virtual Bool SetUp()
	{
		aBoard_.CreateCell(9, 9);

		ASSERT(aBoard_.Set(3, 1));
		ASSERT(aBoard_.Set(6, 6));
		ASSERT(aBoard_.Set(7, 7));
		ASSERT(aBoard_.Set(14, 6));
		ASSERT(aBoard_.Set(17, 4));
		ASSERT(aBoard_.Set(20, 5));
		ASSERT(aBoard_.Set(21, 4));
		ASSERT(aBoard_.Set(24, 1));
		ASSERT(aBoard_.Set(28, 8));
		ASSERT(aBoard_.Set(29, 3));
		ASSERT(aBoard_.Set(31, 6));
		ASSERT(aBoard_.Set(35, 2));
		ASSERT(aBoard_.Set(36, 5));
		ASSERT(aBoard_.Set(44, 8));
		ASSERT(aBoard_.Set(45, 1));
		ASSERT(aBoard_.Set(49, 3));
		ASSERT(aBoard_.Set(51, 7));
		ASSERT(aBoard_.Set(52, 6));
		ASSERT(aBoard_.Set(56, 1));
		ASSERT(aBoard_.Set(59, 3));
		ASSERT(aBoard_.Set(60, 4));
		ASSERT(aBoard_.Set(63, 2));
		ASSERT(aBoard_.Set(66, 5));
		ASSERT(aBoard_.Set(73, 7));
		ASSERT(aBoard_.Set(74, 6));
		ASSERT(aBoard_.Set(78, 2));

		ASSERT(aBoard_.UpdateAllCandidate());
		return True;
	}

	virtual Bool TearDown()
	{
		return aBoard_.DestroyCell();
	}

	int TestCreate()
	{
		ATSudokuEngine::HiddenSingle aHiddenSingle;

		return 0;
	}

	int TestSolve()
	{
		ATSudokuEngine::HiddenSingle aHiddenSingle;

		ASSERT(aHiddenSingle.Solve(aBoard_));

		return 0;
	}

protected:
	ATSudokuEngine::Board aBoard_;
};

#endif